﻿
@{
    ViewBag.Title = Resources.WebStringsWeb.WebTitle;
    Layout = "~/Views/Shared/_LayoutMobile.cshtml";
}
@section css {
    <style>
        .mui-bar ~ .mui-content .mui-scroll-wrapper {
            top: 44px;
            height: auto;
        }
    </style>
}
<header class="mui-bar mui-bar-nav">
    <button type="button" class="mui-left mui-action-back mui-btn mui-btn-link mui-btn-nav mui-pull-left" style="color:white;">
        <span class="mui-icon mui-icon-left-nav" style=""></span>
    </button>
    <h1 class="mui-title" style="color:white;">专项检查登记</h1>
</header>
<div class="mui-content" style="margin: 5px;" ng-cloak ng-controller="CheckFormController" ng-init="
     Id='@(Request.QueryString["Id"].IsEmpty() ? "" : Request.QueryString["Id"])';
     pagename='@(Request.QueryString["pagename"].IsEmpty() ? "" : Request.QueryString["pagename"])';
     GetMyPlaceList();
     GetTaskCheckOption(Id);
     AddModel.FormNo = 'SC'+'@DateTime.Now.ToString("yyMMddHHmmssfff")';
     AddModel.CheckTime = '@DateTime.Now.ToString("yyyy-MM-dd")';
     AddModel.DepartmentId = User.DepartmentId;
     AddModel.DepartmentManager = User.DepartmentManager.UserNo;
     AddModel.TaskId = Id;
     ImageCount = [0,1,2];
     FileList = [];
     CheckItems=[];
     ">
    <form class="mui-input-group">
        <div class="mui-input-row">
            <label>部门</label>
            <input type="text" ng-model="User.DepartmentName" readonly />
        </div>
        <div class="mui-input-row">
            <label>检查日期</label>
            <input type="text" ng-model="AddModel.CheckTime" readonly>
        </div>
        <div class="mui-input-row">
            <label>部门负责人</label>
            <input type="text" ng-model="User.DepartmentManager.UserName" readonly>
        </div>
    </form>
    <h5 class="mui-content-padded">检查场所：</h5>
    <form class="mui-input-group mui-card">
        <div class="mui-input-row mui-checkbox mui-left">
            <label>全选</label>
            <input type="checkbox" id="Department_All" name="Place_All" ng-click="SelectAll('Place_All','PlaceSelected')">
        </div>
        <div class="mui-input-row mui-checkbox mui-left" ng-repeat="x in MyPlaceList">
            <label>{{x.PlaceName}}</label>
            <input name="PlaceSelected" value="{{x.Id}}" id="{{x.Id}}" type="checkbox">
        </div>
    </form>
    <div class="mui-card">
        <ul class="mui-table-view">
            <li class="mui-table-view-cell mui-collapse" ng-repeat="x in TaskOptionList">
                <a ng-init="CheckItems[$index].SortBy=x.SortBy" class="mui-navigate-right" style=" white-space:unset;">
                    {{$index+1}}.{{x.CheckContent}}<br />
                    <span ng-show="CheckItems[$index].Result==1" style="color:green;font-weight:bold;">正常</span><span ng-show="CheckItems[$index].Result==0" style="color: red; font-weight: bold;">异常</span>
                </a>
                <div class="mui-collapse-content" ng-init="CheckItems[$index].OptionId=x.OptionId">
                    <form class="mui-input-group" ng-init="CheckItems[$index].Result=1">
                        <div class="mui-input-row mui-radio mui-left">
                            <label>正常</label>
                            <input name="radio1" type="radio" ng-click="CheckItems[$index].Result=1" checked="checked">
                        </div>
                        <div class="mui-input-row mui-radio mui-left">
                            <label>异常</label>
                            <input name="radio1" ng-click="CheckItems[$index].Result=0" type="radio">
                        </div>
                        <div class="mui-input-row">
                            <label>&nbsp;&nbsp;&nbsp;&nbsp;备注</label>
                            <input type="text" ng-model="CheckItems[$index].Remark" placeholder="此处输入备注">
                        </div>

                    </form>
                    <p style="margin-top:30px;">上传照片（总大小在10M以下）</p>
                    <div class="row image-list" style="margin-top:20px;">
						<img class="image-item space" src="../../Assets/img/upload.png" style="width:55px;height:auto;margin:5px;" ng-repeat="y in ImageCount" id="imagebox-{{x.OptionId}}_{{y}}" ng-click="InitLxImgUpload_SC('imagebox-',x.OptionId,y,Id)"/>
                    </div>
                </div>
            </li>
        </ul>
    </div>



    <div class="mui-button-row" style="margin-bottom:80px;">
        @*<button type="button" ng-click="SaveSpecialCheckForm(AddModel,CheckItems,FileList,0,pagename);" ng-disabled="Loading" class="mui-btn mui-btn-primary mui-btn-block mui-btn-outlined">保 &nbsp;&nbsp;存</button>*@
        <button type="button" ng-click="SaveSpecialCheckForm(AddModel,CheckItems,FileList,1,pagename);" ng-disabled="Loading" class="mui-btn mui-btn-primary mui-btn-block">提 &nbsp;&nbsp;交</button>
    </div>

</div>

@section js{
    <script src="~/Assets/js/base/app-jssdk.umd.min.js"></script>
    <script src="~/Assets/js/libs/upload.js"></script>
    <script src="~/Assets/js/pg/MCheckForm.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")"></script>
    <script>
        mui.showLoading("正在加载..", "div");

        setTimeout(function () {
            mui.hideLoading();
        }, 2000);
    </script>
}